/**
 * 随机排列元素插件
 */
(function($){
	
	$.fn.reorder = function() {
		  function randOrd() { return(Math.round(Math.random())-0.5); }
		 
			  $parent = $(this).eq(0).parent(); //获取父容器
		    var $children = $(this);
		    var childCount = $children.length;
		 
		    if (childCount > 1) {
		      $children.detach();
		 
		      var indices = new Array();
		      for (i=0;i<childCount;i++) { indices[indices.length] = i; }
		      indices = indices.sort(randOrd);
		      
		      //获取选答案的选项
		       //var $answerParent = $parent.siblings("ul.answers");
                var $answerParent = $parent.siblings("ol");
		       var $answers = $answerParent.find("li");
		       $answers.detach();
                $.each(indices,function(j,k) { $parent.append($children.eq(k)); $answerParent.append($answers.eq(k));});
		       //$parent.parent().slideDown("normal");
		    }
		}
})(jQuery);